<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Service Web de métadonnées RBV</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<!-- Le styles -->
<link href="./css/bootstrap.css" rel="stylesheet">
<link href="./css/prettify.css" type="text/css" rel="stylesheet" />
<style type="text/css">
body {
	padding-top: 60px;
	padding-bottom: 40px;
}
</style>
<link href="./css/bootstrap-responsive.css" rel="stylesheet">

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144"
	href="../ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114"
	href="../ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72"
	href="../ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed"
	href="../ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="../ico/favicon.png">
</head>

<body>

	<div class="navbar navbar-inverse navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a class="btn btn-navbar" data-toggle="collapse"
					data-target=".nav-collapse"> <span class="icon-bar"></span> <span
					class="icon-bar"></span> <span class="icon-bar"></span>
				</a> <a class="brand" href="./index.html">Portail RBV</a>
				
				<div class="nav-collapse collapse">
					<ul class="nav">
						<li class="active"><a href="wstest.html">Web service</a></li>
						<li><a href="./doc/metadataws.html">Documentation</a></li>
					</ul>
				</div>
				<!--/.nav-collapse -->
			</div>
		</div>
	</div>

	<div class="container">
		<div class="row">
			<div class="span9">
				<section>
					<div class="page-header">
						<h1>Test de la conversion RBV vers ISO19139</h1>
					</div>
					<p>Version du web service <span id="version">...</span></p>
					<p>Saisissez votre contenu au format RBV dans la zone de texte
						ci-dessous et cliquez sur le bouton souhaité pour générer le
						format ISO19139</p>
						<div class="btn-toolbar">
						<div class="btn-group">
							<a class="btn" href="javascript:generateExample()" rel="tooltip" data-placement="bottom"
								title="Générer un exemple dans la zone ci-dessous"><i
								class="icon-arrow-down"></i> Exemple </a> 
						</div>
					</div>
					<form id="rbvForm" method="POST" action="rest/RBVTo19139/post/download">
					<textarea id="src" name="src" class="span9" rows="10"></textarea>
					</form>

					<div class="btn-toolbar">
						<div class="btn-group">


							<a class="btn" href="javascript:convertToTgt()" rel="tooltip" data-placement="bottom"
								title="Générer dans la zone d'affichage ci-dessous"><i
								class="icon-arrow-down"></i></a> <a class="btn" href="javascript:convertToFile()"
								rel="tooltip" data-placement="bottom"
								title="Générer sous forme de fichier"><i class="icon-file"></i></a>
						</div>
					</div>
					<div class="bs-docs-example"  >
					<pre class="prettyprint" id="tgt2" style="height:500px;overflow:auto;border-width:1px;">
					Zone d'affichage
					</pre>
					</div>
					

				</section>
			</div>
		</div>

		<hr>

		<footer>
			<p>OMP / SEDOO</p>
		</footer>

	</div>
	<!-- /container -->

	<!-- Le javascript
    ================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->
	<script src="http://code.jquery.com/jquery-latest.js"></script>
	<script src="./js/bootstrap.js"></script>
	
<script type="text/javascript" src="./js/prettify.js"></script>
	<script>
	
		function generateExample()
		{
			$.get('rest/RBVTo19139/sampleRBV', function(data) {
				$('#src').text(data).html();
			});
		}
	
		function convertToTgt()
		{
			var srcContent = $('#src').val().trim();
			if (srcContent.length>0)
			{
				$( "#tgt2" ).empty();
				$.post( 'rest/RBVTo19139/post/text', { src: srcContent },
					    function( data ) {
					
							$( "#tgt2" ).text(data).html();
							prettyPrint();
					    }
					  );
			}
			
		}
		
		function convertToFile()
		{
			var srcContent = $('#src').val().trim();
			if (srcContent.length>0)
			{
				$( "#rbvForm" ).submit();
				/*$( "#tgt2" ).empty();
				$.post( 'rest/RBVTo19139/post/download', { src: srcContent },
					    function( data ) {
					
							alert("done");
					    }
					  );*/
			}
			
		}
	
		function updateVersion() {
			$.get('rest/RBVTo19139/version', function(data) {
				$('#version').html(data);
			});
		}
		$(document).ready(function() {
			$("[rel='tooltip']").tooltip();
			
			updateVersion();																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																							
		});
	</script>

</body>
</html>
